<?php $this->load->view("common/page_header");?>
<?php $type_array = array("", "内容违法", "虚假信息", "合作欺诈", "其他");
$deal_array = array("-1" => "会员注销", "-2" => "禁止发言", "-3" => "禁止访问", "1" => "未处理");?>
<div id="body_main">
	<div id="admin_header">
		<?php $this->load->view('common/admin_header'); ?>
		<div class="top_cleft">
			<ul>
				<li><a href="/console/members/user_verify">审批验证</a></li>
				<li class="current"><a href="/console/members/banned">会员管理</a></li>
			</ul>
<!--			<form class="right">-->
<!--				<input type="text" />-->
<!--				<input type="button" value="搜索会员"/>-->
<!--			</form>-->
			<div class="clear"></div>
		</div>
	</div>
	<div id="admin_content">
		<div id="admin_navigator">
			<ul class="navigator">
				<li class="current"><a href="###">会员管理</a></li>
<!--				<li><a href="###">会员统计</a></li>-->
			</ul>
		</div>
		<div id="admin_body">
			<form style="border-bottom:1px solid #bfbfbf;" method="post" action="/console/members/save_banned">
				<div class="form_row">
					<label class="input_label">会员ID：</label>
					<input type="text" name="user_id" class="input_text" value="" style="width:200px"/>
				</div>
				<div class="form_row">
					<label class="input_label">管理类型：</label>
					<input type="radio" name="type" value="-1"/> 会员注销
					<input type="radio" name="type" value="-2" class="margin_left15" /> 禁止发言
					<input type="radio" name="type" value="-3" class="margin_left15" /> 禁止访问
				</div>
				<div class="form_action">
					<input type="submit" class="input_button" value="提交" />
				</div>
			</form>
			<form method="post" action="/console/members/save_banned" id="post-form">
			<div class="margin_top15 margin_bottom10">
				<span class="bold">会员举报记录</span>
				<a href="javascript:void(0)" id="cancel-button" class="orange_button" style="float:right;#margin-top:-26px;">撤销</a>
				<div class="clear"></div>
			</div>
			<?php if (!empty($feedbacks)) {?>
			<table class="a_table">
				<tr>
					<th width="76">会员昵称</th>
					<th width="88">ID号码</th>
					<th width="93">被举报次数</th>
					<th width="110">最近举报记录</th>
					<th width="76">管理记录</th>
					<th width="99">时间</th>
					<td width="71"><input type="checkbox" id="check-all"/>全选</td>
				</tr>
				
				<?php foreach($feedbacks as $feedback) { ?>
				<tr>
					<td><a href="/user/show?user_id=<?php echo $feedback['id'];?>"><?php echo $feedback['nickname'];?></a></td>
					<td><?php echo $feedback['id'];?></td>
					<td><?php echo $feedback['total']?>次</td>
					<td><?php echo $type_array[$feedback['type']]?></td>
					<td><span class="red"><?php echo $deal_array[$feedback['status']]?></span></td>
					<td><?php echo substr($feedback['created'], 0, 10);?></td>
					<td style="text-align:left;padding-left:23px;"><input type="checkbox" name="user_id[]" value="<?php echo $feedback['id'];?>"/></td>
				</tr>
				<?php } ?>
			</table>
			<?php }?>
			<input type="hidden" name="type" value="1"></input>
			</form>
		</div>
		<div class="clear"></div>
	</div>
	<?php $this->load->view("common/footer");?>	
</div>
<script type="text/javascript">
$(document).ready(function(){
	$("#check-all").click(function() {
		$("input[name='user_id[]']").each(function(){
			if($(this).attr("checked") == 'checked') {
				$(this).attr("checked", false);
			} else {
				$(this).attr("checked", true);
			}
		});
	});
	$("#cancel-button").click(function(){
		$("#post-form").submit();
	})
});	
</script>
<?php $this->load->view("common/page_footer");?>